namespace FreeWorkflow.DataAccess.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class FWFfixtaskuserrelation : DbMigration
    {
        public override void Up()
        {
            AddColumn("fwf.Tasks", "AssignedTo_Id", c => c.String(maxLength: 128));
            AddColumn("fwf.Tasks", "ClosedBy_Id", c => c.String(maxLength: 128));
            CreateIndex("fwf.Tasks", "AssignedTo_Id");
            CreateIndex("fwf.Tasks", "ClosedBy_Id");
            AddForeignKey("fwf.Tasks", "AssignedTo_Id", "fwf.Users", "UserId");
            AddForeignKey("fwf.Tasks", "ClosedBy_Id", "fwf.Users", "UserId");
        }
        
        public override void Down()
        {
            DropForeignKey("fwf.Tasks", "ClosedBy_Id", "fwf.Users");
            DropForeignKey("fwf.Tasks", "AssignedTo_Id", "fwf.Users");
            DropIndex("fwf.Tasks", new[] { "ClosedBy_Id" });
            DropIndex("fwf.Tasks", new[] { "AssignedTo_Id" });
            DropColumn("fwf.Tasks", "ClosedBy_Id");
            DropColumn("fwf.Tasks", "AssignedTo_Id");
        }
    }
}
